<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Motor Trend Car Road Tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for mtcars"><tr><td>mtcars</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Motor Trend Car Road Tests</h2>

<h3>Description</h3>

<p>The data was extracted from the 1974 <em>Motor Trend</em> US magazine,
and comprises fuel consumption and 10 aspects of
automobile design and performance for 32 automobiles (1973&ndash;74
models).
</p>


<h3>Usage</h3>

<pre>mtcars</pre>


<h3>Format</h3>

<p>A data frame with 32 observations on 11 (numeric) variables.
</p>

<table summary="Rd table">
<tr>
 <td style="text-align: right;">
    [, 1] </td><td style="text-align: left;"> mpg  </td><td style="text-align: left;"> Miles/(US) gallon </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 2] </td><td style="text-align: left;"> cyl  </td><td style="text-align: left;"> Number of cylinders </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 3] </td><td style="text-align: left;"> disp </td><td style="text-align: left;"> Displacement (cu.in.) </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 4] </td><td style="text-align: left;"> hp   </td><td style="text-align: left;"> Gross horsepower </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 5] </td><td style="text-align: left;"> drat </td><td style="text-align: left;"> Rear axle ratio </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 6] </td><td style="text-align: left;"> wt   </td><td style="text-align: left;"> Weight (1000 lbs) </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 7] </td><td style="text-align: left;"> qsec </td><td style="text-align: left;"> 1/4 mile time </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 8] </td><td style="text-align: left;"> vs   </td><td style="text-align: left;"> Engine (0 = V-shaped, 1 = straight) </td>
</tr>
<tr>
 <td style="text-align: right;">
    [, 9] </td><td style="text-align: left;"> am   </td><td style="text-align: left;"> Transmission (0 = automatic, 1 = manual) </td>
</tr>
<tr>
 <td style="text-align: right;">
    [,10] </td><td style="text-align: left;"> gear </td><td style="text-align: left;"> Number of forward gears </td>
</tr>
<tr>
 <td style="text-align: right;">
    [,11] </td><td style="text-align: left;"> carb </td><td style="text-align: left;"> Number of carburetors
  </td>
</tr>

</table>



<h3>Note</h3>

<p>Henderson and Velleman (1981) comment in a footnote to Table 1:
&lsquo;Hocking [original transcriber]'s noncrucial coding of the
Mazda's rotary engine as a straight six-cylinder engine and the
Porsche's flat engine as a V engine, as well as the inclusion of the
diesel Mercedes 240D, have been retained to enable direct comparisons
to be made with previous analyses.&rsquo;
</p>


<h3>Source</h3>

<p>Henderson and Velleman (1981),
Building multiple regression models interactively.
<em>Biometrics</em>, <b>37</b>, 391&ndash;411.
</p>


<h3>Examples</h3>

<pre>
require(graphics)
pairs(mtcars, main = "mtcars data", gap = 1/4)
coplot(mpg ~ disp | as.factor(cyl), data = mtcars,
       panel = panel.smooth, rows = 1)
## possibly more meaningful, e.g., for summary() or bivariate plots:
mtcars2 &lt;- within(mtcars, {
   vs &lt;- factor(vs, labels = c("V", "S"))
   am &lt;- factor(am, labels = c("automatic", "manual"))
   cyl  &lt;- ordered(cyl)
   gear &lt;- ordered(gear)
   carb &lt;- ordered(carb)
})
summary(mtcars2)
</pre>


</body></html>
